﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HR.Appointments.Service.DataAccessLayer
{
    /// <summary>
    /// Gets the companies from the database
    /// </summary>
    public interface ICompanyDAO
    {
        /// <summary>
        /// Deletes an company from the database
        /// </summary>
        /// <param name="companyId">Company identifier</param>
        void Delete(int companyId);

        /// <summary>
        /// Inserts an company to the database
        /// </summary>
        /// <param name="company">A valid entity</param>
        void Insert(CompanyEntity company);

        /// <summary>
        /// Updates an comany to the database
        /// </summary>
        /// <param name="company">A valid activity</param>
        void Update(CompanyEntity company);

        /// <summary>
        /// Get a valid entity by the unique user identifier
        /// </summary>
        /// <param name="username">Username of a company</param>
        /// <param name="password">Password for the company</param>
        /// <returns>A loaded entity</returns>
        CompanyEntity GetCompanyByUser(string username, string password);

        /// <summary>
        /// Get a valid entit the comanyId
        /// </summary>
        /// <param name="companyId">Company identifier</param>
        /// <returns>A loaded entity</returns>
        CompanyEntity GetInstance(int companyId);

        /// <summary>
        /// Get all companies in the database that has not been deleted
        /// </summary>
        /// <returns>A list of loaded entities</returns>
        List<CompanyEntity> GetAll();

        /// <summary>
        /// Get all companies by name.  Finds companies that start with or end with the given name.
        /// </summary>
        /// <param name="name">Name of the company</param>
        /// <returns>A list of loaded entities</returns>
        List<CompanyEntity> GetByName(string name);
        
    }
}
